home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-07 | 2.5 KB | 101 lines | [TEXT/MPS ] |
- Set Oldecho {echo}; Set echo 0
- Set stdlib "LIBDIR"
- Set linkalso 1
- Set includes ""
- Set compopt ""
- Set linkopt ""
- #Set custom ""
- Set linkfiles ""
- Set ccfiles ""
- Set cclib ""
- Set linkopt ""
- Set linkout Camlc.out
- Set TempFile ":camlprim.`date -n`.c"
- Set TempFile2 ":camlprim.`date -n`"
-
- Set Exit 0
-
- Loop
- If "{1}" == ""
- Break
- Else If "{1}" =~ /(≈)®1.ml/
- camlrun "{stdlib}camlcomp" -stdlib "{stdlib}" {includes} {compopt} "{1}"
- If {Status}
- Set echo {Oldecho}
- Exit {Status}
- End
- Set linkfiles "{linkfiles} {®1}.zo"
- Else If "{1}" =~ /≈.mli/
- camlrun "{stdlib}camlcomp" -stdlib "{stdlib}" {includes} {compopt} "{1}"
- If {Status}
- Set echo {Oldecho}
- Exit {Status}
- End
- Else If "{1}" =~ /≈.zo/
- Set linkfiles "{linkfiles} {1}"
- Else If "{1}" == "-c"
- Set linkalso 0
- Else If "{1}" == "-I" || "{1}" == "-include"
- Set includes "{includes} -I {2}"
- Shift
- Else If "{1}" == "-O" || "{1}" == "-open"
- Set compopt "{compopt} -O {2}"
- Shift
- Else If "{1}" == "-i"
- Set compopt "{compopt} {1}"
- Else If "{1}" == "-g" || "{1}" == "-debug"
- Set linkopt "{linkopt} {1}"
- Else If "{1}" == "-o" || "{1}" == "-exec"
- Set linkout "{2}"
- Shift
- Else If "{1}" == "stdlib"
- Set stdlib "{2}"
- Shift
- Else If "{1}" == "-v" || "{1}" == "-version"
- Echo "The Caml Light system, version 0.61"
- Echo " (standard library from {stdlib})"
- camlrun -V
- camlrun "{stdlib}camlcomp" -version
- camlrun "{stdlib}camllink" -version
- Else If "{1}" == "-files"
- Set linkfiles "{linkfiles} {1} {2}"
- Shift
- # Else If "{1}" == "-custom"
- # Set custom "-custom {TempFile}"
- Else If "{1}" =~ /≈.o/
- Set ccfiles "{ccfiles} {1}"
- Else If "{1}" == "-ccopt"
- Set ccopt "{ccopt} {2}"
- Shift
- Else If "{1}" =~ /-≈/
- Echo "Unknown option ∂"{1}∂", ignored" >Dev:Stderr
- Else
- Echo "I don't know what to do with file ∂"{1}∂", ignored" >Dev:Stderr
- End
- Shift
- End
-
- If {linkalso} && "{linkfiles}" != ""
- camlrun "{stdlib}camllink" -stdlib "{stdlib}" {includes} {linkopt} #{custom} ∂
- -exec "{linkout}" "{stdlib}stdlib.zo" {linkfiles}
- If {Status}
- Set echo {Oldecho}
- Exit {Status}
- End
- # If "{custom}"
- # (Rename "{linkout}" "{TempFile2}" ∂
- # && C -i "{stdlib}" "{TempFile}" ∂
- # && Link -o "{linkout}" {ccopt} {ccfiles} "{TempFile}" "{stdlib}libcaml.o" ∂
- # && Catenate "{TempFile2}" >> "{linkout}")
- # If {Status}
- # Delete -i "{linkout}" "{TempFile}" "{TempFile2}"
- # Exit 2
- # Else
- # Delete -i "{TempFile}" "{TempFile2}"
- # Exit 0
- # End
- # End
- setfile -c 'MPS ' -t TEXT {linkout}
- End
- Set echo {Oldecho}
-